package blog.service.impl;

import blog.dao.ChapterCommentDao;
import blog.pojo.ChapterComment;
import blog.service.ChapterCommentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ChapterCommentServiceImpl  implements ChapterCommentService {

    @Autowired
    private ChapterCommentDao chapterCommentDao;

    @Override
    public List<ChapterComment> getListByChapterId(Integer id) throws Exception {
        return chapterCommentDao.selectList(new QueryWrapper<>(new ChapterComment().setChapterId(id)));
    }
}
